package _3sort.src;


import java.util.Scanner;

/**
 * @className: p_weiyunsuan
 * @description:
 * @author: myself
 * @date: 2025/7/22 20:46
 * @version: 0.1
 * @since: JDK17
 */
/*问题描述：一个数若是能够被m+m+1+...+n来表示，则表示该数是一个诗意数字（即连续的几个数字）m<n
* 给定一个数组，找出不是诗意数字的个数*/
public class p_weiyunsuan {
    public static void main(String[] args) {
        System.out.println("请输入数组的个数");
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] nums = new int[n];
        int count=0;
        for (int i = 0; i < n; i++) {
            nums[i] = sc.nextInt();
        }
        for (int i = 0; i < n; i++){
        if ((nums[i] & (nums[i] - 1))==0) {
            count++;
        }}
        System.out.println(count);
    }
}
